package org.zch.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.zch.common.ApiResult;
import org.zch.service.OpenAdminService;
import org.zch.service.ZuoRuiService;

/**
 * 焯瑞开关
 *
 * @author 赵昌虎
 */
@RestController
@RequestMapping("/openAdmin")
@Api(tags = "开关公共")
public class OpenAdminController {

    @Autowired
    private OpenAdminService openAdminService;

    /**
     * 新增设备
     */
    @ApiOperation(value = "新增公共", notes = "新增公共")
    @PostMapping("/addOpen")
    public ApiResult addOpen(@RequestParam("news") String news,@RequestParam("version") String version,@RequestParam("tips") String tips) {
        return ApiResult.ok(openAdminService.addOpen(news,version,tips));
    }


    /**
     * 获取开关信息
     */
    @ApiOperation(value = "获取公共", notes = "获取公共")
    @GetMapping("/getOpen")
    public ApiResult getOpen() {
        return ApiResult.ok(openAdminService.getOpen());
    }

}
